package com.zdcp.generator.gen;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * 读取代码生成相关配置
 * 
 * @author yweijian
 * @date 2019年9月2日
 * @version 1.0
 */
@Configuration
public class GenConfig {
	/** 作者 */
	public static String author;

	/** 生成包路径 */
	public static String packageName;

	/** 自动去除表前缀，默认是true */
	public static String autoRemovePre;

	/** 表前缀(类名不会包含表前缀) */
	public static String tablePrefix;

	public static String getAuthor() {
		return author;
	}

	@Value("${tool.gen.author}")
	public void setAuthor(String author) {
		GenConfig.author = author;
	}

	public static String getPackageName() {
		return packageName;
	}

	@Value("${tool.gen.packageName}")
	public void setPackageName(String packageName) {
		GenConfig.packageName = packageName;
	}

	public static String getAutoRemovePre() {
		return autoRemovePre;
	}

	@Value("${tool.gen.autoRemovePre}")
	public void setAutoRemovePre(String autoRemovePre) {
		GenConfig.autoRemovePre = autoRemovePre;
	}

	public static String getTablePrefix() {
		return tablePrefix;
	}

	@Value("${tool.gen.tablePrefix}")
	public void setTablePrefix(String tablePrefix) {
		GenConfig.tablePrefix = tablePrefix;
	}
}
